package com.cloud.sky.config;

import com.cloud.sky.component.interceptor.TestEnvFlagInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @author Tyrone
 * @date 2024/8/7 01:07
 */
@Configuration
public class ApplicationConfig extends WebMvcConfigurerAdapter {

    @Autowired
    private TestEnvFlagInterceptor testEnvFlagInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(testEnvFlagInterceptor)
                .addPathPatterns("/**");
        super.addInterceptors(registry);
    }
}
